﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S7Simulate.Utils
{
    public static class ProcessHelper
    {
        //获取所有进程列表
        public static void GetProcessList()
        {
            List<string> list = new List<string>();
            Process[] ps = Process.GetProcesses();
            foreach (Process p in ps)
            {
                list.Add(p.ProcessName);
            }
            //若包含lppa.exe则关闭
            if (list.Contains("lppa"))
            {
                foreach (Process p in Process.GetProcessesByName("lppa"))
                {
                    p.Kill();
                }

            }
        }
    }
}
